package com.lc.demo.service.impl;

import com.lc.demo.bean.User;
import com.lc.demo.mapper.UserMapper;
import com.lc.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Service;

/**
 * @Author: sakila
 * @Date: 2022/03/06/12:14
 * @Description:
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public User login(User user) {
        return userMapper.selectOne(user);
    }

    @Override
    public User findOne(User user) {
        return userMapper.selectOne(user);
    }

    @Override
    public void add(User user) {
        //在插入前将密码加密
        userMapper.insert(user);
    }


    //更新用户头像

    @Override
    public void userInfoUpdate(User user) {
        userMapper.updateByPrimaryKeySelective(user);
    }


}
